/*
 * @Author: li bo
 * @Date: 2025/07/09 17:57:16
 * @LastEditors: li bo
 * @Description: "专辑模型"
 */
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("album", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            comment: '唯一标识',
            defaultValue: Sequelize.UUIDV4,
        },
        title: {
            type: Sequelize.STRING(100),
            notNull: false,
            comment: '专辑名称',
        },
        cover: {
            type: Sequelize.STRING(255),
            defaultValue: '../../public/web-site/website-avatar.jpg',
            comment: '专辑封面URL',
        },
        releaseDate: {
            type: Sequelize.DATEONLY,
            comment: '专辑发行日期',
        }
    }, {
        tableName: 'album',
        comment: '专辑信息表',
        indexes: [
            {
                fields: ['title']
            }
        ]
    })
}